import time

import autoit
from selenium import webdriver
from selenium.webdriver.common.by import By

#创建浏览器驱动对象
driver=webdriver.Edge()
driver.maximize_window()
#你要测试的网址
driver.get("http://127.0.0.1:8848/pagetest/regA.html")
driver.execute_script("window.scrollTo(0,700)")
time.sleep(2)
driver.find_element(By.CSS_SELECTOR,"div[class='zc'] fieldset form div").click()


#1、通过autoit获弹出框的窗口
autoit.win_wait_active("打开",5)
time.sleep(2)
#2、  往输入框里设置值 Edit1
autoit.control_set_text("打开","Edit1",r"C:\Program Files (x86)\AutoIt3\AutoIt.chm")
#3、点击打开按钮
time.sleep(2)
autoit.control_click("打开","Button2")


#让我们的程序休眠
time.sleep(10)
#浏览器驱动对象进行关闭
driver.close()
driver.quit()


